package com.uibase.card.func
{
	import com.uibase.card.Card;
	
	public class CommonCardClickControl implements ICardClickControl
	{
		private var _select:Boolean;
		private var _card:Card;
		
		public function CommonCardClickControl()
		{
		}
		
		public function onCardClick():void
		{
			_select = !_select;
			if(!_card)
			{
				return;
			}
			
			if(_select)
			{
				_card.y -= Card.CARD_SELECTED_Y_POS;
			}
			else
			{
				_card.y += Card.CARD_SELECTED_Y_POS;
			}
		}
		
		public function onCardAttach(card:Card):void
		{
			_card = card;
		}
		
		public function onCardDeattach():void
		{
			_card = null;
		}
		
		public function get card():Card
		{
			return _card;
		}
	}
}